package com.chen.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chen.pojo.Comment;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author chen

 */
@Mapper
public interface CommentMapper extends BaseMapper<Comment> {

    @Select("select * from comment where user_id=#{userId}")
    List<Comment> selectCommentOne(@Param("userId") int userId);

    @Delete("delete from comment where id=#{id}")
    int deleteComment(@Param("id") int id);

    @Select("select count(*) as commentCount from comment")
    int commentCount();


}
